**********************************************************************************************************
**********************************************************************************************************
**********************************************************************************************************
* Do file for Preparing data for
* Are Self-Set Goals Effective Motivators? An Experiment
* by Julia Nafziger, Alexander K. Koch, and Jonas Pilgaard Kaiser
**********************************************************************************************************
**********************************************************************************************************
**********************************************************************************************************

***SET THIS PATH TO ALLOW THE CODE RUN
global path "SET YOUR PATH HERE" // e.g. global path "C:\Documents\EXE\"

//Note that some changes in the raw data were required in order to load the data into Stata for data preparation:
***Manually
**Data fixes
*Only one header is kept
*Duplicates are removed
*One subject was by mistake allowed to complete date 1 and 2 without completing date 0; his observation is deleted
*Date 1: dummy "schedule_error" is added to distinguish the subjects for whom technical errors made their time-schedule invalid

**Renaming
*Date 1: the two timinggoal1_1 and the two timinggoal1_3 are named _late and _revise, respectively
*Date 1: the two slidergoal1_1 are named _late and _revise, respectively
*Date 1: too many columns to import dataset in my version of Stata. Hence, 
         * mean seconds pr. table and errors pr. table are calculated using Python and merged separately 
         * a dataset without data from loops is imported in Stata
*Date 2: commit0, commit1, and influence are named _late, _early, and _revise, respectively
*Date 2: recall1 was not limited to numbers only; data is cleaned so only numbers remain
*Date 2: recall0 and recall1 occurred twice; the latter is named _1 to distinguish the two

//Because emails were the personal identifier allowing to match observations across data sets, the merging and subsequent anonymization of the data has been carried out prior to making the data publicly available. The code commented out below was used for these steps.

********************************************************************************
********************************************************************************
***                        DATA MERGE & ANONYMIZATION                        ***
********************************************************************************
********************************************************************************
/*
***Merge data sets
**Date 0
cd  "C:\Users\Jonas Kaiser\Desktop\Data preparation"
import delimited using "part1_legacy.csv"

*Drop tests of the experiments
drop if v5=="jonas-kaiser@hotmail.com"|v5=="akoch@econ.au.dk"|v5=="jkaiser@econ.au.dk"|v5==""

*Drop those who did not complete date 0
drop if less2h==.

*Rename treatment variable to allow merging
rename treatment d0late

save part1_legacy, replace

**Date 1
clear all
cd  "C:\Users\Jonas Kaiser\Desktop\Data preparation"
import delimited using "part2_legacy_stata.csv"

*Drop tests of the experiments
drop if v5=="jonas-kaiser@hotmail.com"|v5=="akoch@econ.au.dk"|v5=="jkaiser@econ.au.dk"|v5==""

*Drop subjects who did not get to the free work part 
drop if feedbackblock1==.
replace completedtasks2=0 if completedtasks2==.

*Rename to avoid naming conflict when merging data
rename sc0_0 d1productivity1
rename sc1_0 d1flexhours
rename sc2_0 d1productivity2

save part2_legacy_stata, replace

**Average time spent and errors pr. table (loaded separately due to constraints on number of columns loaded into Stata)
clear all
cd  "C:\Users\Jonas Kaiser\Desktop\Data preparation"
import delimited using "part2_extra.csv"

*Drop tests of the experiments
drop if v2=="jonas-kaiser@hotmail.com"|v2=="akoch@econ.au.dk"|v2=="jkaiser@econ.au.dk"|v2==""

*Keep relevant variables
keep v2 meantime meanmistakes

*Renaming variables for merge
rename v2 v5

save part2_extra, replace

*Merge datasets for date 1
clear all
cd  "C:\Users\Jonas Kaiser\Desktop\Data preparation"
use part2_legacy_stata.dta

merge 1:1 v5 using part2_extra, keep(match) generate(p2merge)
drop if p2merge==2
drop p2merge

save part2_legacy, replace

***Date 2
clear all
cd  "C:\Users\Jonas Kaiser\Desktop\Data preparation"
import delimited using "part3_legacy.csv"

*Drop tests of the experiments
drop if v5=="jonas-kaiser@hotmail.com"|v5=="akoch@econ.au.dk"|v5=="jkaiser@econ.au.dk"|v5==""

*Drop subjects who did not complete required part 
drop if feedback==.

save part3_legacy, replace

**Merge data
clear all
cd  "C:\Users\Jonas Kaiser\Desktop\Data preparation"
use part1_legacy.dta

merge 1:1 v5 using part2_legacy, generate(p2completed)
drop if p2completed==2

merge 1:1 v5 using part3_legacy, generate(p3completed)
drop if p3completed==2

**Anonymization
*Generating new ID variable
gen ID=_n
label variable ID "Subject ID"

*Removing all variables containing personal information (names, emails, location, IP addresses, personal ID number, etc.)
drop v1 v3 v5 v6 email firstname lastname q139_2_text cpr cpr2 locationlatitude locationlongitude locationaccuracy q135_2_text q48_2_text 

*Add earningsschedule
append using earningssched

save "$path/DataPreparation/anonymous_data.dta", replace
*/

********************************************************************************
********************************************************************************
***                              DATA CLEANING                               ***
********************************************************************************
********************************************************************************
clear
***Load in data
cd "$path/DataPreparation"
use anonymous_data.dta

***Use merge variables to indicate what parts subjects have completed
recode p2completed (1=0) (3=1)
recode p3completed (1=0) (3=1)

rename p2completed d1completed
rename p3completed d2completed

***Keep relevant variables
keep ID treatment d0late age faculty job degree fieldarts fieldbss fieldhealth fieldst ///
	exams handins risk_1 crt1 crt2 crt3 enjoypre selfcomp_2 less2h ///
	timinggoal0_1 timinggoal0_3 slider0_1 goal0 sc0_0 sc1_0 sc2_0 sc3_0 ///
	schedule_error d1productivity1 d1flexhours d1productivity2 ///
	latego1 revisego1 displaygoal completedtasks2 ///
	timinggoal1_1_late timinggoal1_1_revise timingsliderintro_1 ///
	timinggoal1_3_late timinggoal1_3_revise timingsliderintro_3 ///
	slidergoal1_1_late slidergoal1_1_revise slider2_1 ///
	meantime meanmistakes ///
	p3_timing_error enjoypost recall0 recall1 ///
	caremore goal0inmind altgoal0 goal1inmind altgoal1 ///
	commit01* commit11* influence1_* goalq1_* d1completed d2completed earningssched

***Renaming variables
*Date 0
rename risk_1 risk
rename selfcomp_2 selfcomp
rename sc0_0 crt
rename sc1_0 d0productivity1
rename sc2_0 d0productivity2
rename sc3_0 d0flexhours
rename slider0_1 d0sliderposition
rename less2h uncertainty

*Date 1
rename completedtasks2 effort
rename meantime time_mean
rename meanmistakes mistakes_mean

*Date 2
rename goalq1_1 goalachieve
rename goalq1_2 goalangry
rename goalq1_3 goalafraid
rename goalq1_4 goaluse
rename p3_timing_error d2_timing_error

***Recode values 
*Categorical variables
recode exams (1=0) (2=1) (3=2) (4=3) (5=4)
recode handins (1=0) (2=1) (3=2) (4=3) (5=4)
recode risk (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6) (8=7) (9=8) (10=9) (11=10)
recode enjoypre (1=5) (2=4) (4=2) (5=1)

recode caremore (1=1) (2=-1) (3=0)
recode goal0inmind (1=1) (2=0)
recode goal1inmind (1=1) (2=0)
recode enjoypost (1=5) (2=4) (4=2) (5=1)

replace uncertainty=6-uncertainty

*Coding errors for subjects at date 0
replace d0late=1 if d0late==. & ID<399
replace d0late=1 if d0late==0 & d1completed==1 & treatment!=2 & treatment!=3 & treatment!=4

drop if d0late==0 & goal0==.

*Formatting
destring crt1, ignore(",") replace

***Generating variables for analysis
*Date 0
gen d0response_time = timinggoal0_3 - timinggoal0_1
replace d0response_time=300 if d0response_time>300 & d0response_time!=.

gen d0slidermoved =.
replace d0slidermoved=0 if d0sliderposition==0
replace d0slidermoved=1 if d0sliderposition>0 & d0sliderposition!=.

gen uncertainty_high=0 if uncertainty!=.
replace uncertainty_high=1 if uncertainty==1 | uncertainty==2

gen uncertainty_low=0 if uncertainty!=.
replace uncertainty_low=1 if uncertainty==4 | uncertainty==5

gen d0time_constrained=0 if d0flexhours!=.
replace d0time_constrained=1 if d0flexhours<=2

gen econbusi=0 if faculty!=.
replace econbusi=1 if fieldbss==1

gen examassign=exams + handins

*Date 1
gen goal1=revisego1
replace goal1=latego1 if treatment==1

gen d1response_time = timingsliderintro_3 - timingsliderintro_1
replace d1response_time = timinggoal1_3_late - timinggoal1_1_late if treatment==1
replace d1response_time = timinggoal1_3_revise - timinggoal1_1_revise if treatment>2
replace d1response_time = 300 if d1response_time>300 & d1response_time!=.

gen d1sliderposition = slidergoal1_1_late 
replace d1sliderposition = slider2_1 if treatment==2
replace d1sliderposition = slidergoal1_1_revise if treatment>2 

gen d1slidermoved =.
replace d1slidermoved=0 if d1sliderposition==0
replace d1slidermoved=1 if d1sliderposition>0 & d1sliderposition!=.

gen d1time_constrained=.
replace d1time_constrained=1 if d1flexhours<=2
replace d1time_constrained=0 if d1flexhours>2 & d1flexhours!=.

gen revisegoal1=.
replace revisegoal1=goal1 if treatment==3 | treatment==4

*Date 2
gen commit0=(commit01_1_early + commit01_2_early + commit01_3_early)/3
replace commit0=(commit01_1_revise0 + commit01_2_revise0 + commit01_3_revise0)/3 if treatment==3
replace commit0=(commit01_1_revise1 + commit01_2_revise1 + commit01_3_revise1)/3 if treatment==4

gen commit1=(commit11_1_late + commit11_2_late + commit11_3_late)/3
replace commit1=(commit11_1_revise0 + commit11_2_revise0 + commit11_3_revise0)/3 if treatment==3
replace commit1=(commit11_1_revise1 + commit11_2_revise1 + commit11_3_revise1)/3 if treatment==4

gen screengoal=influence1_1_early
replace screengoal=influence1_1_late if treatment==1
replace screengoal=influence1_1_revise0 if treatment==3
replace screengoal=influence1_1_revise1 if treatment==4

gen offscreengoal=influence1_2_revise0
replace offscreengoal=influence1_2_revise1 if treatment==4

gen altgoal=influence1_2_early
replace altgoal=influence1_2_late if treatment==1
replace altgoal=influence1_3_revise0 if treatment==3
replace altgoal=influence1_3_revise1 if treatment==4

gen timegoal=influence1_3_early
replace timegoal=influence1_3_late if treatment==1
replace timegoal=influence1_4_revise0 if treatment==3
replace timegoal=influence1_4_revise1 if treatment==4

gen earningsgoal=influence1_4_early
replace earningsgoal=influence1_4_late if treatment==1
replace earningsgoal=influence1_5_revise0 if treatment==3
replace earningsgoal=influence1_5_revise1 if treatment==4

gen piece_rate=influence1_5_early
replace piece_rate=influence1_5_late if treatment==1
replace piece_rate=influence1_6_revise0 if treatment==3
replace piece_rate=influence1_6_revise1 if treatment==4

gen other_factors=influence1_6_early
replace other_factors=influence1_6_late if treatment==1
replace other_factors=influence1_7_revise0 if treatment==3
replace other_factors=influence1_7_revise1 if treatment==4

*Across dates
*Generating variables for analysis
gen flexhours_change=.
replace flexhours_change=0 if d0time_constrained==d1time_constrained & treatment!=.
replace flexhours_change=1 if d0time_constrained!=d1time_constrained & treatment!=.

gen productivity_change = d1productivity1 - d0productivity1

gen base_productivity=.
replace base_productivity=d0productivity1 if treatment==2
replace base_productivity=d1productivity1 if treatment==1

gen goalrevision_cont=.
replace goalrevision_cont=goal1-goal0 if treatment==3 | treatment==4

gen goalrevision_bin=.
replace goalrevision_bin=0 if goal0==goal1 & (treatment==3 | treatment==4)
replace goalrevision_bin=1 if goal0!=goal1 & (treatment==3 | treatment==4)

gen finalgoal = goal1
replace finalgoal = goal0 if treatment==2

gen sliderposition=.
replace sliderposition=d0sliderposition if treatment==2
replace sliderposition=d1sliderposition if treatment==1

gen response_time=.
replace response_time=d0response_time if treatment==2
replace response_time=d1response_time if treatment==1

gen slidermoved=.
replace slidermoved=0 if treatment==1 | treatment==2
replace slidermoved=1 if sliderposition!=0 & sliderposition!=.

gen time_constrained=.
replace time_constrained=d0time_constrained if treatment==2
replace time_constrained=d1time_constrained if treatment==1

gen achieve_cont_display = effort - displaygoal 

gen achieve_cont0=.
replace achieve_cont0=effort-goal0

gen achieve_cont1=.
replace achieve_cont1=effort-goal1

gen achieve_cont_final = effort - finalgoal 

gen achieve_bin_display = .
replace achieve_bin_display = 0 if effort<displaygoal
replace achieve_bin_display = 1 if effort>=displaygoal & effort!=.

gen achieve_bin_final = .
replace achieve_bin_final = 0 if effort<finalgoal
replace achieve_bin_final = 1 if effort>=finalgoal & effort!=.

gen achieve_bin_0 = .
replace achieve_bin_0 = 0 if effort<goal0 & goal0!=.
replace achieve_bin_0 = 1 if effort>=goal0 & effort!=. & goal0!=.

gen achieve_bin_1 = .
replace achieve_bin_1 = 0 if effort<goal1 & goal1!=.
replace achieve_bin_1 = 1 if effort>=goal1 & effort!=. & goal1!=.

gen moretime=.
replace moretime=0 if treatment!=.
replace moretime=1 if d0time_constrained==1 & d1time_constrained==0

gen lesstime=.
replace lesstime=0 if treatment!=.
replace lesstime=1 if d0time_constrained==0 & d1time_constrained==1

gen time_shock=.
replace time_shock=0 if lesstime==0 & moretime==0
replace time_shock=1 if lesstime==1 | moretime==1

gen timediff=d1flexhours-d0flexhours

gen enjoychange=.
replace enjoychange=enjoypost-enjoypre if enjoypre!=. & enjoypost!=.

***Drop auxilliary variables 
*Date 0
drop timinggoal0_3 timinggoal0_1

*Date 1
drop revisego1 latego1 ///
	timinggoal1_3* timinggoal1_1* timingsliderintro* ///
	slidergoal1* slider2_1

*Date 2
drop influence*
	
***Label variables
*Date 0
label variable crt "CRT"
label variable risk "Risk tolerance"
label variable selfcomp "Self-competition"
label variable d0productivity1 "Productivity, Date 0"
label variable d0flexhours "Flex. hours, Date 0"
label variable d0sliderposition "Slider position, Date 0"
label variable age "Age"
label variable faculty "Faculty"
label variable job "Job"
label variable degree "Degree"
label variable fieldarts "Field of study, Arts"
label variable fieldbss "Field of study, BSS"
label variable fieldhealth "Field of study, Health"
label variable fieldst "Field of study, ST"
label variable exams "Exams"
label variable handins "Assignments"
label variable crt1 "CRT1"
label variable crt2 "CRT2"
label variable crt3 "CRT3"
label variable enjoypre "Pleasure in task"
label variable uncertainty "Uncertainty"
label variable uncertainty_low "Low uncertainty"
label variable uncertainty_high "High uncertainty"
label variable goal0 "Goal 0"
label variable d0response_time "Response time"
label variable d0slidermoved "Slider moved, Date 0"
label variable d0time_constrained "Time-constrained, Date 0"
label variable econbusi "Economics/Business"
label variable examassign "Exams \& Assignments"
label variable d0late "Late"

label define faculty_label 1 "Arts" 2 "BSS" 3 "Health" 4 "Science and Technology" 5 "Not student" 6 "Other"
label values faculty faculty_label

label define job_label 1 "University employee" 2 "Public employment" 3 "Private employment" 4 "Self-employed" 5 "Unemployed" 6 "Other"
label values job job_label

label define degree_label 1 "Bachelor" 2 "Master" 3 "PhD" 4 "Other"
label values degree degree_label

label define fieldarts_label 1 "Archaeology" 2 "Anthropology" 3 "Languages" 4 "Information studies" 5 "Theology" 6 "Other"
label values fieldarts fieldarts_label

label define fieldbss_label 1 "Business/Economics" 2 "Law" 3 "Political Sciences" 4 "Psychology" 5 "Other"
label values fieldbss fieldbss_label

label define fieldhealth_label 1 "Dentistry" 2 "Medicine" 3 "Publich health" 4 "Sports sciences" 5 "Other"
label values fieldhealth fieldhealth_label

label define fieldst_label 1 "Agrobiology" 2 "Biology" 3 "Chemistry" 4 "Computer Science" 5 "Data Science" 6 "Engineering" 7 "Physics" 8 "Geoscience" 9 "IT Product Development" 10 "Chemistry" 11 "Mathematics" 12 "Mathematics-Economics" 13 "Nanoscience" 14 "Other"
label values fieldst fieldst_label

label define enjoypre_label 1 "Dislike a great deal" 2 "Dislike somewhat" 3 "Neither like nor dislike" 4 "Like somewhat" 5 "Like a great deal"
label values enjoypre enjoypre_label

label define uncertainty_label 1 "Extremely likely" 2 "Somewhat likely" 3 "Neither likely nor unlikely" 4 "Somewhat unlikely" 5 "Extremely unlikely"
label values uncertainty uncertainty_label

*Date 1
label variable schedule_error "Schedule error"
label variable d1productivity1 "Productivity 1"
label variable d1flexhours "Flex. hours, Date 1"
label variable treatment "Treatment"
label variable goal1 "Goal 1"
label variable displaygoal "Displayed goal"
label variable revisegoal1 "Revise x Goal 1"
label variable effort "Effort"
label variable d1sliderposition "Slider position, Date 1"
label variable d1response_time "Response time"
label variable d1slidermoved "Slider moved, Date 1"
label variable d1time_constrained "Time-constrained1"
label variable time_mean "Average time pr. table"
label variable mistakes_mean "Average mistakes pr. table"

label define treatment_label 1 "Late" 2 "Early" 3 "Revise0" 4 "Revise1"
label values treatment treatment_label

*Date 2
label variable enjoypost "Pleasure in task, ex post"
label variable recall0 "Remembered goal 0"
label variable recall1 "Remembered goal 1"
label variable caremore "Care more"
label variable goal0inmind "Goal 0 in mind"
label variable altgoal0 "Alt. goal 0 in mind"
label variable goal1inmind "Goal 1 in mind"
label variable altgoal1 "Alt. goal 1 in mind"
label variable goalachieve "Achieve"
label variable goalangry "Angry"
label variable goalafraid "Afraid"
label variable goaluse "Goal use"
label variable commit0 "Commitment, goal 0"
label variable commit1 "Commitment, goal 1"
label variable screengoal "Goal on screen"
label variable offscreengoal "Goal off screen"
label variable altgoal "Alt. goal"
label variable timegoal "Time goal"
label variable earningsgoal "Earnings goal"
label variable piece_rate "Piece rate"
label variable other_factors "Other factors"
label variable d2_timing_error "Timing error"

label define enjoypost_label 1 "Like a great deal" 2 "Like somewhat" 3 "Neither like nor dislike" 4 "Dislike somewhat" 5 "Dislike a great deal"
label values enjoypost enjoypost_label

label define caremore_label 1 "Cared more about goal 0" -1 "Cared more about goal 1" 0 "Cared equally about the goals"
label values caremore caremore_label 

label define goalachieve_label 1 "Not like me at all" 2 "Not much like me" 3 "Somewhat like me" 4 "Mostly like me" 5 "Very much like me"
label values goalachieve goalachieve_label 

label define goalangry_label 1 "Not like me at all" 2 "Not much like me" 3 "Somewhat like me" 4 "Mostly like me" 5 "Very much like me"
label values goalangry goalangry_label 

label define goalafraid_label 1 "Not like me at all" 2 "Not much like me" 3 "Somewhat like me" 4 "Mostly like me" 5 "Very much like me"
label values goalafraid goalafraid_label 

label define goaluse_label 1 "Not like me at all" 2 "Not much like me" 3 "Somewhat like me" 4 "Mostly like me" 5 "Very much like me"
label values goaluse goaluse_label 

label define screengoal_label 1 "Not at all" 2 "Slightly" 3 "Moderately" 4 "Quite a bit" 5 "Extremely"
label values screengoal screengoal_label 

label define offscreengoal_label 1 "Not at all" 2 "Slightly" 3 "Moderately" 4 "Quite a bit" 5 "Extremely"
label values offscreengoal offscreengoal_label 

label define altgoal_label 1 "Not at all" 2 "Slightly" 3 "Moderately" 4 "Quite a bit" 5 "Extremely"
label values altgoal altgoal_label 

label define timegoal_label 1 "Not at all" 2 "Slightly" 3 "Moderately" 4 "Quite a bit" 5 "Extremely"
label values timegoal timegoal_label 

label define earningsgoal_label 1 "Not at all" 2 "Slightly" 3 "Moderately" 4 "Quite a bit" 5 "Extremely"
label values earningsgoal earningsgoal_label 

label define piece_rate_label 1 "Not at all" 2 "Slightly" 3 "Moderately" 4 "Quite a bit" 5 "Extremely"
label values piece_rate piece_rate_label 

label define other_factors_label 1 "Not at all" 2 "Slightly" 3 "Moderately" 4 "Quite a bit" 5 "Extremely"
label values other_factors other_factors_label 

*New variables
label variable flexhours_change "Change in flex. hours"
label variable productivity_change "Change in productivity"
label variable base_productivity "Productivity"
label variable goalrevision_cont "Goal revision"
label variable goalrevision_bin "Goal revision"
label variable finalgoal "Final Goal"
label variable sliderposition "Slider position"
label variable response_time "Response time"
label variable slidermoved "Slider moved"
label variable time_constrained "Time-constrained"
label variable achieve_cont_display "Goal achievement, displayed goal"
label variable achieve_cont_final "Goal achievement, final goal"
label variable achieve_cont0 "Goal achievement, goal 0"
label variable achieve_cont1 "Goal achievement, goal 1"
label variable achieve_bin_display "Binary goal achievement, displayed goal"
label variable achieve_bin_final "Binary goal achievement, final goal"
label variable lesstime "Less time"
label variable moretime "More time"
label variable timediff "Difference in flexible time"
label drop _merge

*Removing outliers as defined in pre-registration
drop if effort>901 & effort!=.
drop if goal0>901 & goal0!=.
drop if goal1>901 & goal1!=.
replace ID=_n if faculty!=.

*Clear date 2 data for one subject who by mistake received the link for date 2 without having completed date 1
foreach i in recall1 enjoypost enjoychange goal0inmind goalachieve goalangry goalafraid goaluse commit1 {
	replace `i'= . if d2completed==1 & d1completed==0
}
replace d2completed = 0 if d2completed==1 & d1completed==0

*Ordering variables (ID, treatment, outcomes, controls, exploratory, background)
order ID treatment effort goal0 goal1 displaygoal finalgoal revisegoal1 goalrevision_cont ///
	goalrevision_bin achieve_cont_display achieve_cont0 achieve_cont1 achieve_cont_final achieve_bin_display achieve_bin_0 achieve_bin_1 ///
	achieve_bin_final time_mean mistakes_mean d0productivity1 d0productivity2 d1productivity1 d1productivity2 ///
	productivity_change base_productivity d0flexhours d1flexhours flexhours_change time_shock lesstime moretime ///
	timediff uncertainty uncertainty_high uncertainty_low d0time_constrained ///
	d1time_constrained time_constrained examassign crt crt1 crt2 crt3 enjoypre risk selfcomp ///
	d0sliderposition d1sliderposition sliderposition d0response_time d1response_time response_time ///
	d0slidermoved d1slidermoved slidermoved exams handins recall0 recall1 ///
	enjoypost enjoychange caremore goal0inmind altgoal0 goal1inmind altgoal1 goalachieve ///
	goalangry goalafraid goaluse commit0 commit1 screengoal offscreengoal ///
	altgoal timegoal earningsgoal piece_rate other_factors d1completed d2completed d0late age faculty ///
	job degree fieldarts fieldbss fieldhealth fieldst econbusi ///
	schedule_error d2_timing_error commit01* commit11* earningssched

*Saving dataset: all data in Data Preparation folder, variables used for replication in Input folder
compress
save "$path/DataPreparation/cleaned_data.dta", replace

keep ID treatment effort goal0 goal1 displaygoal revisegoal1 goalrevision_cont goalrevision_bin ///
	achieve_cont_display achieve_cont0 achieve_cont1 achieve_bin_display achieve_bin_0 achieve_bin_1 ///
	time_mean mistakes_mean d0productivity1 d1productivity1 productivity_change base_productivity ///
	time_shock lesstime moretime timediff uncertainty uncertainty_high d0time_constrained d1time_constrained time_constrained examassign ///
	crt enjoypre risk selfcomp d0response_time d1response_time response_time d0slidermoved d1slidermoved slidermoved ///
	recall0 recall1 enjoypost enjoychange caremore goal0inmind altgoal0 goal1inmind altgoal1 d1completed d2completed ///
	d0late age faculty degree econbusi schedule_error earningssched commit0 commit1
save "$path/Input/ReplicationData.dta", replace

